import { StyleSheet, Text, TouchableOpacity, View } from 'react-native'
import React from 'react'

interface ToDoIem {
  title: string,
  id: number
}

export default function todoItem(props: { item: ToDoIem, pressHandler: Function }) {

  return (
    <TouchableOpacity onPress={() => props.pressHandler(props.item.id)}>
      <Text style={styles.item}>{props.item.title}</Text>
    </TouchableOpacity>
  )
}

const styles = StyleSheet.create({
  item: {
    padding: 16,
    marginTop: 16,
    borderColor: '#bbb',
    borderWidth: 1,
    borderStyle: 'dashed',
    borderRadius: 10
  }
})